package work.shyk.kongMonitor.dto.param;

import lombok.AllArgsConstructor;
import lombok.Data;
import work.shyk.kongMonitor.dto.param.interfaces.QueryObj;

import java.util.HashMap;

/**
 * description: <br>
 * createTime: 2021/3/24 16:38 <br>
 *
 * @author zzh
 */
public class ScriptObj extends HashMap implements QueryObj {

    public ScriptObj(String inline) {
        put("script", new Script(inline));
    }


    public ScriptObj(String inline, String lang) {
        put("script", new Script(inline, lang));
    }


    @Data
    @AllArgsConstructor
    class Script {
        private String inline;
        private String lang = "painless";


        public Script(String inline) {
            this.inline = inline;
        }
    }
}
